<template>
    <transition name="fade" mode="out-in">
        <router-view></router-view>
    </transition>
</template>
<script>
import C from '#/src/common/common.js'
import Guest from '#/src/shop/guest.js'
import {remote} from 'electron'
export default {
    name: 'app',
    data() {
        return {
        }
    },
    methods: {},
    computed: {},
    mounted: async function() {
        // 开发环境监听f12
        if (process.env.NODE_ENV == 'development') {
            window.onkeyup = function (e) {
                if (e.keyCode == 123) {
                    let win = remote.getCurrentWindow()
                    win.webContents.openDevTools()
                }
            }
        }
        let data = C.getDatas()
        let info = await Guest.getGuestInfo(data.id)
        let shopid = JSON.parse(C.getLocalStorage('initConfig')).shopid
        if (shopid != info.departmentid) {
            this.$router.push('crossShop')
        } else {
            this.$router.push('index')
        }
    }
}
</script>
<style>
.fade-enter-active,
.fade-leave-active {
    transition: opacity .1s;
}

.fade-enter,
.fade-leave-to
/* .fade-leave-active below version 2.1.8 */

{
    opacity: 0;
}
</style>